import {createRouter, createWebHistory} from 'vue-router';
// 引入你定义的组件
import Home from '@/view/Home.vue'; // 假设这是你的首页组件
import hospitalInfo from '@/view/hospitalInfo.vue'; // 假设这是你的首页组件
import myInfo from '@/view/myInfo.vue'; // 假设这是你的首页组件
import departmentSelection from '@/view/registration/departmentSelection.vue';
import parientRegistration from '@/components/registration/parientRegistration.vue';
import menu from '@/components/Home/menu.vue';
const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home,
        redirect:"/menu",
        children:[
            {
                path: "menu",
                component: menu,
                meta: {
                  requireAuth: true,  // 该路由项需要权限校验
                },
                
              },
            {
                path: "departmentSelection",
                component: departmentSelection,
                meta: {
                  requireAuth: true,  // 该路由项需要权限校验
                },
              },
              {
                path: "parientRegistration",
                component: parientRegistration,
                meta: {
                  requireAuth: true,  // 该路由项需要权限校验
                },
              },
        ]
    }, {
        path: '/hospitalInfo',
        name: 'hospitalInfo',
        component: hospitalInfo
    }, {
        path: '/myInfo',
        name: 'myInfo',
        component: myInfo
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes // short for `routes: routes`
});

export default router;